#ifndef ROUNDBORDERSTRATEGY_H
#define ROUNDBORDERSTRATEGY_H

#pragma once

#include "../../ToolkitLayer.h"
#include "BorderStrategy.h"

/**
 * This strategy provides a round border that has diameter equal to the
 * smallest between the width and height values of the associated component.
 *
 * @author Fabricio Anastacio - fabriciocfa@yahoo.com
 * @since August 17, 2007
 */
class TOOLKITLAYER_API RoundBorderStrategy : public BorderStrategy
{
	// Attributes
protected:
	/** The number of segments the border circle is divided. */
	unsigned int nSegments;
	/** The scaleX value currently used by the display list. */
	float dlScaleX;
	/** The scaleY value currently used by the display list. */
	float dlScaleY;

	// Methods
public:
	/**
	 * Cronstructs a round border strategy.
	 */
	RoundBorderStrategy(void);
	/**
	 * Destroys this strategy.
	 */
	~RoundBorderStrategy(void);

	// ACCESSOR METHODS
	/**
	 * Returns the number of segments in which the border circle is divided.
	 *
	 * @return the number of segments in which the border circle is divided.
	 */
	unsigned int getNumberSegements() { return nSegments; };
	/**
	 * Sets the number of segments in which the border circle is divided.
	 *
	 * @param nSegs the number of segments in which the border circle is divided.
	 */
	void setNumberSegments(unsigned int nSegs) { nSegments = nSegs; };


protected:
	/**
	 * Creates the display list to draw this border.
	 */
	void createDisplayList();

	/**
	 * Defines the drawing strategy for the associated component.
	 *
	 * @param enablePicking if true, draw for selection mode (adding the
	 * component id).
	 */
	void draw(const std::vector<unsigned long>& selectedIds);
};

#endif // ROUNDBORDERSTRATEGY_H
